<!-- Created by jack on 2022/4/2 - 15:03 -->
<style scoped lang="less">
.select-box{
  &__item{
    transition: color,background-color ease-in-out 300ms;
    padding: 8px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    &:hover:not(.active){
      background: #b7b5b5;
    }
    color: #525252;
    font-weight: 500;
    &__icon{
      width: 20px;
      height: 20px;
      margin-right: 10px;
    }
    &__title{
      font-size: 12px;
    }
  }
}
.active{
  background: linear-gradient(to right,#c4c4c4,#e5dfdf,rgba(255,255,255,0.95), rgba(255,255,255,0.95));
  color: #e85d5d;
}
</style>

<template>
<div class="select-box">
  <div class="select-box__item" :class="{'active': props.value === ele.value}" :key="index" v-for="(ele,index) of props.itemList" @click="emits('update:value',ele.value)">
    <img :src="ele.icon" class="select-box__item__icon">
    <span class="select-box__item__title">{{ ele.name }}</span>
  </div>
</div>
</template>

<script lang="ts" setup>
const emits = defineEmits(['input','update:value'])
const props = defineProps({
  value:{ type:String, default:'' },
  itemList:{ type:Array, default: () => ([]) }
})




</script>
